package com.example.nio.commons;

import com.example.nio.commons.ChatMessage;
import com.example.nio.commons.Message;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * @author: KChange
 * @date: 2020/12/18
 * @description: 隔离Mongodb和Domain的中间Pojo
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Document(collection = "nioMessage")
@Builder
public class MMessage extends ChatMessage implements Serializable {

    private static final long serialVersionUID = -7906371347449669918L;

//    自定义递增id,不使用即为自生成id
//    @AutoIncKey
    @Id
    private String messageId;


}
